package cn.bellychang.compositepattern.demo01;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

/**
 * @author ChangLiang
 * @date 2020/4/26
 */
public class AppTest {

    @Test
    @DisplayName("test composite pattern")
    public void test() {
        Picture picture = new Picture();
        picture.add(new Line());
        picture.add(new Rectangle());

        Picture picture1 = new Picture();
        picture1.add(new Text());
        picture1.add(new Line());
        picture1.add(new Rectangle());

        picture.add(picture1);
        picture.draw();
    }
}
